#include "../include/snakeSound.h"

void introSound(void)
{
	/*	0 1
		1 2
		2 3
		3 4
		4 5
		5 6
		6 7*/

	int delay	=	100;
	playBlockSound(4, delay * 2);
	playBlockSound(7, delay * 2);
	playBlockSound(4, delay * 2);
	playBlockSound(7, delay * 2);
	playBlockSound(2, delay * 2);
	playBlockSound(3, delay * 2);

	playBlockSound(4, delay * 2);
	playBlockSound(7, delay * 2);
	playBlockSound(4, delay * 2);
	playBlockSound(7, delay * 2);

	playBlockSound(2, delay);
	playBlockSound(1, delay);
	playSound(0, delay);

}

void winSound(void)
{
	eatSound();
	eatSound();
	eatSound();

	int i	=	16;
	while(i >= 0)
	{
		playBlockSound(i, 50 + i * 4);
		--i;
	}	
}

void deathSound(void)
{
	eatSound();
	eatSound();
	eatSound();

	int i	=	0;
	while(i < 16)
	{
		playBlockSound(i, 50 + i * 4);
		i++;
	}
}

void eatSound(void)
{
	playBlockSound(0, 50);
	playBlockSound(1, 50);
	playSound(0, 50);
}
